<template>
  <div class="hello">
    <p>我是模态框</p>
    <slot></slot>
    <div style="height:30px"></div>
    <button @click="close">关闭按钮</button>
  </div>
</template>

<script>
export default {
  methods: {
    close() {
      this.$destroy()
      if (this.$el) document.body.removeChild(this.$el)
    },
  },
}
</script>
<style scoped>
.hello {
  padding: 20px;
  border: 2px solid green;
}
</style>

<style scoped></style>
